cmake_minimum_required(VERSION 3.16)

set(PRONAME QtChatter)

project(${PRONAME} LANGUAGES CXX)

set(CMAKE_INCLUDE_CURRENT_DIR ON)

set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(Qt5 COMPONENTS Widgets Network REQUIRED)

set(HEADERS
    mainwindow.h
    historydialog.h
    serverssettingsdialog.h
    classes/chathistory.h
    classes/model.h
    classes/tcpclient.h
    classes/aithread.h
    classes/historystorage.h
    utils/xio.h
)

set(SOURCES
    main.cpp
    mainwindow.cpp
    historydialog.cpp
    serverssettingsdialog.cpp
    classes/chathistory.cpp
    classes/model.cpp
    classes/aithread.cpp
    classes/tcpclient.cpp
    classes/historystorage.cpp
    utils/xio.cpp
)

set(UI_LIST
    mainwindow.ui
    historydialog.ui
    serverssettingsdialog.ui
)

add_executable(${PRONAME}
    ${HEADERS}
    ${SOURCES}
    ${UI_LIST}
)

target_link_libraries(${PRONAME} PRIVATE Qt5::Widgets Qt5::Network)
